use std::collections::HashSet;

pub fn new_count_distinct(input_str: &str) -> usize {
    let mut count = 0;
    let mut set = HashSet::new();
    // use a hashset to store existed strings
    input_str.split(',').for_each(|s| {
        if s.len() <= 0 {
            return;
        }
        // already existed, continue 
        if set.contains(s) {
            return;
        }
        set.insert(s);
        count += 1;
    });
    count as usize
}
